package org.hackystat.ui.orb.client.common;

import java.util.ArrayList;

import com.google.gwt.user.client.rpc.RemoteService;

/**
 * Remote procedure call interface for communicating with the Sensorbase and 
 * DailyProjectData services. 
 * 
 * @author David J. Nickles
 */
public interface RPCRemoteService extends RemoteService {

  /**
   * This method sets a specific color and animation on the Orb.
   * 
   * @param orb the state of the Ambient Orb.
   * @return String the response state.
   */
  public String putOrb(AmbientOrb orb);
  
  /**
   * This method retrieves the host uris for the Sensorbase and DailyProjectData services from the
   * Project Viewer properties file.
   * 
   * @return An arraylist of the host uris for the Sensorbase and DailyProjectData services from the
   * Project Viewer properties file.
   * 
   * @gwt.typeArgs <java.lang.String>
   */
  public ArrayList getHosts(); 

  /**
   * Returns true if the passed host is a DailyProjectData Analysis service host.
   * 
   * @param host the URI for the DailyProjectData host.
   * @return Boolean indicating if the host is a valid DailyProjectData Analysis service.
   */
  public Boolean isDailyProjectDataHost(String host);

  /**
   * Returns true if the passed host is a SensorBase service host.
   * 
   * @param host the URI for the SensorBase.
   * @return Boolean indicating if the host is a valid SensorBase service.
   */
  public Boolean isSensorBaseHost(String host);

  /**
   * Returns true if the user and password is registered as a user with this host.
   * 
   * @param host the URI for the SensorBase
   * @param user user to authentication
   * @param password key for authentication
   * @return Boolean indicating if the user and password are valid in the sensorbase
   */
  public Boolean isRegistered(String host, String user, String password);

  /**
   * Registers the user with this host.
   * 
   * @param host the URI for the SensorBase
   * @param user user to authentication
   * @return Boolean indicating if the user and password are valid in the sensorbase
   */
  public Boolean registerUser(String host, String user);
  
  /**
   * Returns the attributes set in the Manifest file.
   * 
   * @return a list of strings of attribute values from the Manifest file.
   *
   * @gwt.typeArgs <java.lang.String>
   */
  public ArrayList getManifest(); 
  
  /**
   * Return a formatted description of the requested sensor data on the specified interval.
   * @param uri the URI for the SensorBase
   * @param project the project of interest
   * @param user user to authentication
   * @param password user password for authentication
   * @param year of interval
   * @param month of interval
   * @return Boolean array of days with data
   * @throws RPCException if problems occur during the Sensorbase procedure call
   * 
   * @gwt.typeArgs <java.lang.Boolean>
   */
  public ArrayList getOverview(String uri, String project, String user, String password, 
    int year, int month) throws RPCException;  
    
  /**
   * Logs the message from the javascript client.
   * 
   * @param text message to log.
   */
  public void logClient(String text);
}
